package com.ruoyi.web.controller.bl;

import com.ruoyi.bl.domain.BlAd;
import com.ruoyi.bl.domain.BlOrder;
import com.ruoyi.bl.service.IBlAdService;
import com.ruoyi.bl.service.IBlOrderService;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.core.domain.entity.SysDictType;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.service.ISysDictDataService;
import com.ruoyi.system.service.ISysDictTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 商户广告Controller
 * 
 * @author ruoyi
 * @date 2024-12-08
 */
@RestController
@RequestMapping("/bl/app")
public class BlAppController extends BaseController
{
    @Autowired
    private ISysDictTypeService dictTypeService;

    @Autowired
    private ISysDictDataService dictDataService;

    @Autowired
    private IBlOrderService blOrderService;

    @Anonymous
    @GetMapping("/dictTypeList")
    public AjaxResult dictTypeList(SysDictType dictType)
    {
        List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
        return success(list);
    }

    @Anonymous
    @GetMapping("/dictDataList")
    public AjaxResult dictDatalist(SysDictData dictData)
    {
        List<SysDictData> list = dictDataService.selectDictDataList(dictData);
        return success(list);
    }

    /**
     * 查询订单信息列表
     */
    @PreAuthorize("@ss.hasPermi('bl:order:psList')")
    @GetMapping("/gettBlOrderPsList")
    public TableDataInfo list(BlOrder blOrder) {
        startPage();
        blOrder.setDeliveryId(getUserId());
        List<BlOrder> list = blOrderService.selectBlOrderPsList(blOrder);
        return getDataTable(list);
    }

}
